---
title: Change default
description: A change default operation changes the default value of a column.
---

## Structure

<YamlJsonTabs>
```yaml
alter_column:
  table: table name
  column: column name
  default: new default value | null
  up: SQL expression
  down: SQL expression
```
```json
{
  "alter_column": {
    "table": "table name",
    "column": "column name",
    "default": "new default value" | null,
    "up": "SQL expression",
    "down": "SQL expression"
  }
}
```
</YamlJsonTabs>

The `default` expression is subject to the usual SQL quoting rules. In particular, string literals should be surrounded with `''`.

To remove a column default, set the `default` field to `NULL`.

## Examples

### Make multiple column changes

An alter column migration that makes multiple changes including setting the default:

<ExampleSnippet example="35_alter_column_multiple.yaml" languange="yaml" />

### Drop a column default

Drop a default by setting the `default` field to `null`.

<ExampleSnippet example="46_alter_column_drop_default.yaml" languange="yaml" />
